	
	//라운드목록
	function clsClubRoundAssignView_Info(){
		this._HTMLDom = null;
		this.listData = null;
		this._init();
	}
	
	clsClubRoundAssignView_Info.prototype = {
		_init: function(){
			
			var $layer = $("section#club_round_assign_view>section");
			this._HTMLDom = {
				"$layer": $layer
				, "$element": $layer.find("ul:first")				
			}
			$layer.find("ul").remove();
			this.$getBtnAssign().hide();
		}
		, setData: function(thisData){
			this.listData = thisData;
			this.display();
		}	
		, display: function(){
			var $layer = this._HTMLDom["$layer"];
			var $element = this._HTMLDom["$element"];
			var thisClass = this;
			
			for(var i=0;i<this.listData.length;++i){
				$layer.append($element.clone(true));
			}
			
			$layer.find("ul").each(function(n){
				$(this).find("li:eq(0)").html(thisClass.listData[n]["팀명"] +"<em>"+ thisClass.listData[n]["라운드시간"] +":"+ thisClass.listData[n]["라운드분"] +"</em>");
				$(this).find("li:eq(1)").empty();
				if(!thisClass.listData[n]["사람1"]){
					$(this).find("li:eq(1)").html("아직 팀 배정이 확정되지 않았습니다.");
				}else {
					for(var i=1;i<=4;++i){
						var txt = "사람"+i;
						if(thisClass.listData[n][txt]){
							$(this).find("li:eq(1)").append("<span>"+ thisClass.listData[n][txt]["닉네임"] +"</span>");
						}
					}
				}
			});
		}
		, $getLayer: function(){			
			return this._HTMLDom["$layer"];
		}		
		, $getBtnAssign: function(){			
			return this._HTMLDom["$layer"].find("div.club_btn a");
		}
	}
	
	//데이터연동		
	function clsComm_ClubRoundAssignView(){		
		this.clubRoundInfo = null;
		this.clubRoundInfoRequest = null;
		this.clubRoundReply = null;
		this.clubRoundReplyRequest = null;
		
		this._init();
	}	
	clsComm_ClubRoundAssignView.prototype = {
		_init: function(){
			this.clubRoundInfoRequest = {
				 "동호회키":null
				, "라운드키": null
				, "페이지": null				
			}
			 
			this.clubRoundReplyRequest = {
				"동호회키": null
				, "라운드키": null
				, "댓글키": null	
			}
		}
//------------------------ 라운드목록------------------------//		
		, getClubRoundInfo: function(){
			var thisClass = this;
			
			var szClubSeq = this.clubRoundInfoRequest["동호회키"];
			var szRoundSeq = this.clubRoundInfoRequest["라운드키"]
			
			var objJson = new MJson();
        	var cm = new ConnectionManager();
			
			objJson.putClient("userid", _util.getLogin("아이디"));
        	objJson.putPub("sid", "CL001");
        	objJson.putPub("servicename","getMyClubRoundInfo");   
        					
        	objJson.putParameter("clubSeq", szClubSeq);
        	objJson.putParameter("roundSeq", szRoundSeq);
			
			cm.requestGet(objJson.getJsonString(), function(ret){
				thisClass.clubRoundInfo = [];
				
				var items = ret["msp"]["contents"]["items"];
			
				if(items){
					var team = items["roundInfo"]["roundTeamInfoList"][0]["items"];
					var arr = [];
					
					if(team){
												
						if(!team.length){
							team = new Array(team);
						}						
						var user= [];						
						//팀별정보
						for(var k=0;k<team.length;++k){							
							user[k] = [];							
							//팀별 사용자(최대4명) 정보
							for(var m=0;m<4;++m){
								var str = "assignedUser"+ (m+1) +"Info";
								if(team[k][str]){
									user[k][m]={
										"아이디": _util.nvl(team[k][str]["userId"])
										, "이미지": _util.nvl(team[k][str]["path"]) + _util.nvl(team[k][str]["saveFileName"])
										, "닉네임": _util.nvl(team[k][str]["nickname"])
										, "지역": _util.nvl(team[k][str]["region"])
										, "연령대": _util.nvl(team[k][str]["age"])
										, "성별": _util.nvl(team[k][str]["sex"])
										, "핸디": _util.nvl(team[k][str]["handi"])
										, "평타": _util.nvl(team[k][str]["average"])
									}								
								}
							}
							
							thisClass.clubRoundInfo.push({
								"팀키": _util.nvl(team[k]["teamSeq"])
								, "팀명": _util.nvl(team[k]["teamName"])
								, "라운드시간": _util.nvl(team[k]["roundHour"])
								, "라운드분": _util.nvl(team[k]["roundMinute"])
								, "사람1": _util.nvl(user[k][0])
								, "사람2": _util.nvl(user[k][1])
								, "사람3": _util.nvl(user[k][2])
								, "사람4": _util.nvl(user[k][3])
							});
						}
					}
				}
			
				$(thisClass).trigger("evtFinishClubRoundInfo");
			}, function($err) {
				alert("evtFinishClubRoundInfo->"+$err);
			});	
		}
		, getClubRoundInfoData: function(){
			return this.clubRoundInfo;
		}
		, setClubRoundInfoRequest: function(key, val){
			this.clubRoundInfoRequest[key] = val;
		}	
//------------------------ 라운드목록------------------------//		
	}
	
	//컨트롤파일
	function ClubRoundAssignView(){				
		this.objComm = null;
		this.club_seq = null;	
		this.round_seq = null;
		
		this.club_info = null;		
		this.objClubRoundAssignView_Info = null;
	};
	
	ClubRoundAssignView.prototype = {
	    onPageShow : function() {	    
	    	$("a").attr("href", "").attr("data-rel", "");      
	    	this._init();	    		    	
	    }
	    , _beforeStart: function(){
	    	var 	thisClass = this;
	    	
	    	this._permitStart = {
				"동호회정보": false	
			}
			
	  		// 서버 메시지맵
			$.ajax({
				url: "../js/src/club/club_inc.js"
				, type: "get"
				, dataType: "script"
				, async: false
				, success: function(ret, sta){
					//alert("success!!");					
				}
				, error:function(e){
					alert("error=" + e);
				}	
			});
			
			_cb.getClubInfoData({
				"콜백": function(ret, l){
					thisClass._permitStart["동호회정보"] = true;	
				}
			});
			
			_util.executeThread(function(){
				for(key in thisClass._permitStart){		
					if(!thisClass._permitStart[key]) return false;
				}
				return (true);
			}, function(){			
				thisClass._start();
			});
	    }
	    , _init: function(){	    	    	
	    	this.objComm = new clsComm_ClubRoundAssignView();
			this.objClubRoundAssignView_Info = new clsClubRoundAssignView_Info();
			
	      this.getParam();
	      
	      this._beforeStart();
	    	
	    	this._role();
	       
	      	this._bind();	 
	      	this._eventFinish();     	
	    }
	    , _start: function(){	    	
	    	//동호회기본정보
	    	this.club_info = _cb.getClubInfo();	    	
	    	
	    	//라운드팀정보 조회
			this.spinStart();				
			this.objComm.setClubRoundInfoRequest("동호회키",this.club_seq);
			this.objComm.setClubRoundInfoRequest("라운드키",this.round_seq);
			this.objComm.getClubRoundInfo();
	    }
	    , _eventFinish: function(){
	    	var thisClass = this;
	    	
	    	//라운드팀정보 조회 완료 이벤트 
			$(this.objComm).bind("evtFinishClubRoundInfo", function(){
				var thisData = thisClass.objComm.getClubRoundInfoData();
				if(!thisData) {
					alert("조회된 라운드정보가 없습니다.");
					_gf.CLUB_DATA = {
						"동호회키": thisClass.club_seq	
					}
					$.mobile.changePage("../club/club_round.html","slide",true);				
				}
				
				if(thisClass.club_info.isAdmin()) {
					thisClass.objClubRoundAssignView_Info.$getBtnAssign().show();
				}
				thisClass.spinEnd();
				thisClass.objClubRoundAssignView_Info.setData(thisData);
			});
	    }
		 , _bind: function(){
		 	var thisClass = this;
		 	
		 	//배정하기
		 	this.objClubRoundAssignView_Info.$getBtnAssign().click(function(event){
		 		event.preventDefault();
		 		_gf.CLUB_DATA = {
		 			"동호회키": thisClass.club_seq
		 			, "라운드키": thisClass.round_seq
		 		}
				$.mobile.changePage("club_assign.html","slide",true); 
		 	});
		 		 	
		 	//메뉴
		 	$("section#club_round_assign_view nav ul li a:eq(0)").click(function(event){
		 		event.preventDefault();
		 		thisClass.goNavi();
		 	});
		 	
		 	//알림
		 	$("section#club_round_assign_view nav ul li:eq(1)").click(function(event){
		 		event.preventDefault();
		 		$.mobile.changePage("../inc/info_booking.html","slide",true);	
		 	});
		 	
		 	//이전
		 	$("section#club_round_assign_view header div.top_title_B div.top_right a.btn11").click(function(event){
		 		event.preventDefault();
		 		_gf.CLUB_DATA = {
					"동호회키": thisClass.club_seq	
					, "라운드키": thisClass.round_seq
				}
		 		$.mobile.changePage("club_round_view.html","slide",true);	
		 	});
		 }
		 , getParam: function(){
	    	this.club_seq = _gf.CLUB_DATA["동호회키"];	    	    	
	    	this.round_seq = _gf.CLUB_DATA["라운드키"];
	    }
	    , _role: function(){
	    		
	   }
		, goNavi: function(){			
			$.mobile.changePage("../inc/navi.html","slide",true);
		}
		, goLogin: function(){
			_gf.LOGIN_DATA.loginAfterUrl = "../club/club_round_assign_view.html";
			$.mobile.changePage("../member/login.html","slide",true); 
		}
	    , spinStart: function(){		
			$.mobile.showPageLoadingMsg();			
		}
		, spinEnd: function(){			
	 		$.mobile.hidePageLoadingMsg();				
		}
	}